project_dir = os.scriptdir()
project_name = project_dir:match(".+[/\\]([%w_]+)")

csdk_root = "G:/AIR780ETGG-CSDK/luatos-soc-2024/" --csdk根目录,可自行修改
includes(csdk_root.."csdk.lua")
description_common()
--add_undefines("LUAT_USE_NETWORK")
--add_undefines("LUAT_USE_LWIP")
--add_undefines("__USE_SDK_LWIP__")
--add_undefines("LUAT_USE_DNS")
target(project_name,function()
    set_kind("static")
    set_targetdir("$(buildir)/".. project_name .. "/")
    description_csdk()
    -- set_warnings("error")

    -- mbedtls
    add_defines("LUAT_USE_TLS",{public = true})
    -- cjson
	if chip_target ~= "ec718pv" and chip_target ~= "ec718u" then
        add_includedirs(luatos_root .. "/components/cjson")
		add_files(luatos_root.."/components/cjson/*.c")
	end
    --加入代码和头文件
    add_includedirs("./main/inc",{public = true})
    add_files("./main/src/*.c",{public = true})
    add_includedirs("./peripherals/led/inc",{public = true})
    add_files("./peripherals/led/src/*.c",{public = true})
    add_includedirs("./board/inc",{public = true})
    add_files("./board/src/*.c",{public = true})
    add_includedirs("./mqtt/inc",{public = true})
    add_files("./mqtt/src/*.c",{public = true})
    add_includedirs("./lte/inc",{public = true})
    add_files("./lte/src/*.c",{public = true})
    add_includedirs("./common/inc",{public = true})
    add_files("./common/src/*.c",{public = true})
    add_includedirs("./app_event/inc",{public = true})
    add_files("./app_event/src/*.c",{public = true})
    add_includedirs("./gnss/inc",{public = true})
    add_files("./gnss/src/*.c",{public = true})
    add_includedirs("./lowpower/inc",{public = true})
    add_files("./lowpower/src/*.c",{public = true})
    add_includedirs(luatos_root.."/components/network/libemqtt", {public = true})
    add_files(luatos_root.."/components/network/libemqtt/*.c")
    remove_files(luatos_root.."/components/network/libemqtt/luat_lib_mqtt.c")
    add_includedirs(luatos_root .. "/luat/include",{public = true})
    add_includedirs(luatos_root.."/components/network/libhttp", {public = true})
    add_includedirs(luatos_root.."/components/network/http_parser", {public = true})
    add_files(luatos_root.."/components/network/libhttp/*.c")
    remove_files(luatos_root.."/components/network/libhttp/luat_lib_http.c")
    add_files(luatos_root.."/components/network/http_parser/*.c")

end)
